package com.agou.ssh.core.base;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ActionResultSet {
	
	public String CallModel = "";
	public Class<?> CallClass ;
	
	public boolean IsSuccess = true;
	public String ReturnCode = "0";
	public String ReturnInfo = "成功";

	private Map<String, Object> _dataMap = new HashMap<String, Object>();//
	private Map<String, BOResultSet> _boResultSets = new HashMap<String, BOResultSet>();//
	private List<Object> _dataList = new ArrayList<Object>();//
	
	public void addBoResultSet(String key,BOResultSet boResu){
		_boResultSets.put(key,boResu);
	}
	
	public BOResultSet getBoResultSet(String key){
		return (BOResultSet)_boResultSets.get(key);
	}

	public ActionResultSet(Class<?> thisClass){
		CallClass = thisClass;
	} 	
	
	public String getCallModel() {
		return CallModel;
	}

	public void setCallModel(String callModel) {
		this.CallModel = callModel;
	}

	public void addDataMap(String key, Object value) {
		_dataMap.put(key, value);
	}

	public String getDataMapValueToStr(String key) {
		return String.valueOf(_dataMap.get(key));// new String() (String);
	}

	public Object getDataMapValue(String key) {
		return _dataMap.get(key);
	}

	public void addDataList(Object value) {
		_dataList.add(value);
	}

	public Map<String, Object> getDataMap() {
		return _dataMap;
	}

	public List<Object> getDataList() {
		return _dataList;
	}

	public String toString() {
		StringBuilder sbStr = new StringBuilder();
		sbStr.append("成功：").append(IsSuccess).append("\n");
		sbStr.append("返回代码：").append(ReturnCode).append("\n");
		sbStr.append("返回信息：").append(ReturnInfo).append("\n");
		sbStr.append("BoMap：").append(_boResultSets).append("\n");
		sbStr.append("Map：").append(_dataMap).append("\n");
		sbStr.append("List：").append(_dataList).append("\n");
		return sbStr.toString();
	}
}
